package com.tms.monitoring.controller;

import com.ruoyi.common.core.domain.R;
import com.tms.monitoring.service.FileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("pricture")
@CrossOrigin
public class FileUploadController {
    @Autowired
    private FileUploadService fileUploadService;

    @RequestMapping("/fileUpload")
    public R uploadFile(MultipartFile file) {
     String path=fileUploadService.uploadFile(file);
        return R.ok(path);
    }

}
